package com.star.bookstore.member.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.io.Serializable;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 
 * 
 * @author wuLiFei
 * @email wuLiFei@gmail.com
 * @date 2021-03-07 19:18:32
 */
@Data
@TableName("ums_user")
public class UserEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	public UserEntity() {
	}


	/**
	 * 用户id
	 */
	@TableId
	private Long userId;
	/**
	 * 手机号（用户账号）
	 */
	@Pattern(regexp = "^1\\d{10}$",message = "号码必须是以1为开始的11位数字")
	private String mobile;
	/**
	 * 登录密码
	 */
	@Pattern(regexp = "^[a-zA-Z]{4,9}$",message = "密码长度必须是4-9位")
	private String password;
	/**
	 * 邮箱
	 */
	@Email(message = "邮箱不合法")
	private String email;
	/**
	 * 昵称
	 */
	@NotBlank(message = "用户名必须提交")
	@Pattern(regexp = "^[a-zA-Z]{2,6}$",message = "用户名必须是2-6位")
	private String username;
	/**
	 * 注册时间
	 */
	private String createTime;
	/**
	 * 账户余额
	 */
	private BigDecimal balance;
	/**
	 * 购买次数
	 */
	private Integer buyCount;
	/**
	 * 销售次数
	 */
	private Integer sellCount;
	/**
	 * 总花费
	 */
	private BigDecimal sumLose;
	/**
	 * 总赚取
	 */
	private BigDecimal sumGet;
	/**
	 * 登录状态
	 */
	private Boolean LoginStatus;
	/**
	 * 登录码
	 */
	private String loginNumber;



}
